package myapp.shape;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class SaveResult {
    public void saveResult(String string)
    {
        try{
            String data = string;

            File file = new File("result.txt");
            if(!file.exists()){
                file.createNewFile();
            }
            FileWriter fileWritter = new FileWriter(file.getName(),true);
            fileWritter.write(data);
            fileWritter.close();
            System.out.println("已经输入至文件当中");
        }catch(IOException e){
            e.printStackTrace();
        }
    }
}
